home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ControlStrip.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  8.6 KB  |  217 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ControlStrip.p
  3.  
  4.      Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5.  
  6.      Version:    Technology:    ControlStrip 1.4
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1992-1997 by Apple Computer, Inc. All rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ControlStrip;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CONTROLSTRIP__}
  28. {$SETC __CONTROLSTRIP__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ControlStripIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MENUS__}
  38. {$I Menus.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __DIALOGS__}
  41. {$I Dialogs.p}
  42. {$ENDC}
  43.  
  44.  
  45. {$PUSH}
  46. {$ALIGN MAC68K}
  47. {$LibExport+}
  48.  
  49. {********************************************************************************************
  50.  
  51.     messages passed to the modules
  52.  
  53. ********************************************************************************************}
  54.  
  55. CONST
  56.     sdevInitModule                = 0;                            {  initialize the module }
  57.     sdevCloseModule                = 1;                            {  clean up before being closed }
  58.     sdevFeatures                = 2;                            {  return feature bits }
  59.     sdevGetDisplayWidth            = 3;                            {  returns the width of the module's display }
  60.     sdevPeriodicTickle            = 4;                            {  periodic tickle when nothing else is happening }
  61.     sdevDrawStatus                = 5;                            {  update the interface in the Control Strip }
  62.     sdevMouseClick                = 6;                            {  user clicked on the module's display area in the Control Strip }
  63.     sdevSaveSettings            = 7;                            {  saved any changed settings in module's preferences file }
  64.     sdevShowBalloonHelp            = 8;                            {  puts up a help balloon, if the module has one to display }
  65.  
  66. {********************************************************************************************
  67.  
  68.     Features supported by the module.  If a bit is set, it means that feature is supported.
  69.     All undefined bits are reserved for future use by Apple, and should be set to zero.
  70.  
  71. ********************************************************************************************}
  72.     sdevWantMouseClicks            = 0;                            {  notify the module of mouseDown events }
  73.     sdevDontAutoTrack            = 1;                            {  call the module to do mouse tracking }
  74.     sdevHasCustomHelp            = 2;                            {  module provides its own help messages }
  75.     sdevKeepModuleLocked        = 3;                            {  module needs to be locked in the heap }
  76.  
  77. {********************************************************************************************
  78.  
  79.     Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  80.     If a bit is set, the module can request that a specific function is performed by
  81.     the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  82.     for future use by Apple, and should be set to zero.
  83.  
  84. ********************************************************************************************}
  85.     sdevResizeDisplay            = 0;                            {  resize the module's display }
  86.     sdevNeedToSave                = 1;                            {  need to save changed settings, when convenient }
  87.     sdevHelpStateChange            = 2;                            {  need to update the help message because of a state change }
  88.     sdevCloseNow                = 3;                            {  close a module because it doesn't want to stay around }
  89.  
  90.  
  91. {********************************************************************************************
  92.  
  93.     miscellaneous
  94.  
  95. ********************************************************************************************}
  96.     sdevFileType                = 'sdev';                        {  module's file type }
  97.  
  98.     sdevMenuItemMark            = $A5;                            {  ‘•’: ‘checkmark’ to use in popup menus }
  99.  
  100.  
  101. {     direction values for SBDrawBarGraph }
  102.  
  103.     BarGraphSlopeLeft            = -1;                            {  max end of sloping bar graph is on the left }
  104.     BarGraphFlatRight            = 0;                            {  max end of flat bar graph is on the right }
  105.     BarGraphSlopeRight            = 1;                            {  max end of sloping bar graph is on the right }
  106.  
  107. {********************************************************************************************
  108.  
  109.     utility routines to provide standard interface elements and support for common functions
  110.  
  111. ********************************************************************************************}
  112. FUNCTION SBIsControlStripVisible: BOOLEAN;
  113.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  114.     INLINE $7000, $AAF2;
  115.     {$ENDC}
  116. PROCEDURE SBShowHideControlStrip(showIt: BOOLEAN);
  117.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  118.     INLINE $303C, $0101, $AAF2;
  119.     {$ENDC}
  120. FUNCTION SBSafeToAccessStartupDisk: BOOLEAN;
  121.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  122.     INLINE $7002, $AAF2;
  123.     {$ENDC}
  124. FUNCTION SBOpenModuleResourceFile(fileCreator: OSType): INTEGER;
  125.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  126.     INLINE $303C, $0203, $AAF2;
  127.     {$ENDC}
  128. FUNCTION SBLoadPreferences(prefsResourceName: ConstStr255Param; VAR preferences: Handle): OSErr;
  129.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  130.     INLINE $303C, $0404, $AAF2;
  131.     {$ENDC}
  132. FUNCTION SBSavePreferences(prefsResourceName: ConstStr255Param; preferences: Handle): OSErr;
  133.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  134.     INLINE $303C, $0405, $AAF2;
  135.     {$ENDC}
  136. PROCEDURE SBGetDetachedIndString(theString: StringPtr; stringList: Handle; whichString: INTEGER);
  137.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  138.     INLINE $303C, $0506, $AAF2;
  139.     {$ENDC}
  140. FUNCTION SBGetDetachIconSuite(VAR theIconSuite: Handle; theResID: INTEGER; selector: LONGINT): OSErr;
  141.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  142.     INLINE $303C, $0507, $AAF2;
  143.     {$ENDC}
  144. FUNCTION SBTrackPopupMenu({CONST}VAR moduleRect: Rect; theMenu: MenuHandle): INTEGER;
  145.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  146.     INLINE $303C, $0408, $AAF2;
  147.     {$ENDC}
  148. FUNCTION SBTrackSlider({CONST}VAR moduleRect: Rect; ticksOnSlider: INTEGER; initialValue: INTEGER): INTEGER;
  149.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  150.     INLINE $303C, $0409, $AAF2;
  151.     {$ENDC}
  152. FUNCTION SBShowHelpString({CONST}VAR moduleRect: Rect; helpString: StringPtr): OSErr;
  153.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  154.     INLINE $303C, $040A, $AAF2;
  155.     {$ENDC}
  156. FUNCTION SBGetBarGraphWidth(barCount: INTEGER): INTEGER;
  157.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  158.     INLINE $303C, $010B, $AAF2;
  159.     {$ENDC}
  160. PROCEDURE SBDrawBarGraph(level: INTEGER; barCount: INTEGER; direction: INTEGER; barGraphTopLeft: Point);
  161.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  162.     INLINE $303C, $050C, $AAF2;
  163.     {$ENDC}
  164. PROCEDURE SBModalDialogInContext(filterProc: ModalFilterUPP; VAR itemHit: INTEGER);
  165.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  166.     INLINE $303C, $040D, $AAF2;
  167.     {$ENDC}
  168. { The following routines are available in Control Strip 1.2 and later. }
  169. FUNCTION SBGetControlStripFontID(VAR fontID: INTEGER): OSErr;
  170.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  171.     INLINE $303C, $020E, $AAF2;
  172.     {$ENDC}
  173. FUNCTION SBSetControlStripFontID(fontID: INTEGER): OSErr;
  174.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  175.     INLINE $303C, $010F, $AAF2;
  176.     {$ENDC}
  177. FUNCTION SBGetControlStripFontSize(VAR fontSize: INTEGER): OSErr;
  178.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  179.     INLINE $303C, $0210, $AAF2;
  180.     {$ENDC}
  181. FUNCTION SBSetControlStripFontSize(fontSize: INTEGER): OSErr;
  182.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  183.     INLINE $303C, $0111, $AAF2;
  184.     {$ENDC}
  185. FUNCTION SBGetShowHideHotKey(VAR modifiers: INTEGER; VAR keyCode: UInt8): OSErr;
  186.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  187.     INLINE $303C, $0412, $AAF2;
  188.     {$ENDC}
  189. FUNCTION SBSetShowHideHotKey(modifiers: INTEGER; keyCode: ByteParameter): OSErr;
  190.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  191.     INLINE $303C, $0213, $AAF2;
  192.     {$ENDC}
  193. FUNCTION SBIsShowHideHotKeyEnabled(VAR enabled: BOOLEAN): OSErr;
  194.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  195.     INLINE $303C, $0214, $AAF2;
  196.     {$ENDC}
  197. FUNCTION SBEnableShowHideHotKey(enabled: BOOLEAN): OSErr;
  198.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  199.     INLINE $303C, $0115, $AAF2;
  200.     {$ENDC}
  201. { The following routines are available in Control Strip 1.4 and later. }
  202. FUNCTION SBHitTrackSlider({CONST}VAR moduleRect: Rect; ticksOnSlider: INTEGER; initialValue: INTEGER; VAR hit: BOOLEAN): INTEGER;
  203.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  204.     INLINE $303C, $0616, $AAF2;
  205.     {$ENDC}
  206.  
  207. {$ALIGN RESET}
  208. {$POP}
  209.  
  210. {$SETC UsingIncludes := ControlStripIncludes}
  211.  
  212. {$ENDC} {__CONTROLSTRIP__}
  213.  
  214. {$IFC NOT UsingIncludes}
  215.  END.
  216. {$ENDC}
  217.